home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 031_045 / 034c / Text
Encoding:
Text File  |  1993-08-02  |  35.4 KB  |  842 lines

  1. 22nd July 1992
  2. -----------------------------------------------------------------------------
  3. Support Group Application Note 
  4. Number: 034
  5. Issue: 1 
  6. Author:
  7. -----------------------------------------------------------------------------
  8.  
  9. EdBin and Move User Guide
  10.  
  11. -----------------------------------------------------------------------------
  12. Applicable Hardware: BBC Master 512
  13.  
  14. Related Application Notes:
  15.  
  16.  
  17. -----------------------------------------------------------------------------
  18. Copyright (C) Acorn Computers Limited 1992
  19.  
  20. Every effort has been made to ensure that the information in this leaflet is 
  21. true and correct at the time of printing. However, the products described in
  22. this leaflet are subject to continuous development and improvements and
  23. Acorn Computers Limited reserves the right to change its specifications at
  24. any time. Acorn Computers Limited cannot accept liability for any loss or
  25. damage arising from the use of any information or particulars in this
  26. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  27. Limited.
  28. -----------------------------------------------------------------------------
  29. Support Group
  30. Acorn Computers Limited
  31. Acorn House
  32. Vision Park
  33. Histon
  34. Cambridge       CB4 4AE
  35. -----------------------------------------------------------------------------
  36.  
  37.  
  38. 1.1  Introduction
  39.  
  40. EdBin allows you to EDit BINary files, ie executable object code files or
  41. data files that cannot be loaded into ordinary word processor or text
  42. editor.  The file can be examined after loading into memory and modified if
  43. necessary.  Commands are available to edit the file using hexadecimal or
  44. ASCII values, initialise blocks of the file to a specified constant, copy
  45. blocks to different locations, search for a specific string and compare two
  46. blocks of the file.  After editing, the data can be written back to the
  47. original file or to a different file if required.  All EdBin commands can be
  48. terminated at any time using CTRL-C or suspended using CTRL-S.  If the
  49. output is suspended using CTRL-S it can be restarted using any key except
  50. CTRL-C, CTRL-S or BREAK.  The EdBin program can be found on the DOS Plus
  51. Boot Disc, disc 1.
  52.  
  53.  
  54. 1.2  Starting EdBin
  55.  
  56. To start EdBin type:
  57.         EDBIN <filename>
  58. where <filename> is the file that you want to edit.  The file will be loaded
  59. into memory by EdBin when it starts up and it will then respond with a ' - '
  60. prompt to indicate that it is ready to accept commands.
  61.  
  62. Alternatively, EdBin can be started up by simply typing:
  63.         EDBIN
  64. EdBin will be loaded and respond with the prompt as before but no file will
  65. be loaded to edit.  In this mode memory can be examined and modified and
  66. written to a disc file.  If at any time the user wants to edit a file rather
  67. than memory the file can be loaded in using the R(EAD) <filename> command
  68. which loads the file in as if EDBIN <filename> had been typed.
  69.  
  70.  
  71. 1.3  EdBin Commands
  72.  
  73. All the EdBin commands are single letter commands followed by up to three
  74. parameters.  The following table summarises the available commands. 
  75.  
  76. Command                 Function 
  77.  
  78. C <range> <address>     C(ompare)       blocks of memory 
  79. D (<range>)             D(ump)          memory in hex and ASCII formats 
  80. E <address>             E(dit)          memory using hex or ASCII values 
  81. F <range> <byte | word> F(ill)          memory with a constant value 
  82. H                       H(elp)          give summary of commands 
  83. M <range> <address>     M(ove)          blocks of memory 
  84. Q                       Q(uit)          return to DOS + command prompt 
  85. R <filename>            R(ead)          file into memory for editing 
  86. S <range> <"string">    S(earch)        memory for specified string
  87. W (<filename>)          W(rite)         memory to disc file
  88.  
  89. where:  <address> = (<segment>:) <offset>
  90.         <range>    = (<segment>:) <start offset> <end offset>
  91.  
  92. The above commands are now explained in more detail.  Where <offset> is used
  93. it refers to a hexadecimal offset address which can be entered as 1 to 4
  94. digits -leading zeros can be omitted ie 7A can be entered as 7A, 07A or
  95. 007A.  If more than 4 hex digits are entered the most significant digits
  96. will be truncated ie 12345 will be treated as 2345. Where an <end offset> is
  97. required it refers to the end offset + 1, ie,
  98.         D 100 180
  99. will dump the bytes between 100H and 17FH inclusive.  to specify the end
  100. address of a 64k segment in 16 bits an end offset of 0 must be used ie,
  101.         F C000 0 E5
  102. will fill the last 4 Kbytes of the current segment with the byte E5H.
  103.  
  104. Where <segment> is used it refers to a 80186 segment address which can also
  105. be entered as 1 to 4 hex digits but must be followed immediately by a : to
  106. indicate that it is a segment value.  In all relevant commands below if no
  107. segment address is specified that most recently specified value is used or
  108. the segment address of the file buffer if no previous value has been
  109. specified.  For all commands any leading or trailing spaces will ignored. 
  110. Items enclosed in <> brackets indicate parameters that the command must
  111. have, items also enclosed in () brackets indicate optional parameters that
  112. do not have to be specified.  Items separated by the | character indicate
  113. that the command can take several different parameters but only one can be
  114. specified at a time.  
  115.  
  116. All commands can be entered in upper or lower case (or both).
  117.  
  118.  
  119. C(ompare)
  120.  
  121. Syntax: C (<segment>:) <source start> <source end> (<segment>:) <dest start>
  122. where   <start> = <start offset> ; <end> = <end offset>
  123.         <dest>  = <destination>
  124.  
  125. Function:       Compare the specified block of memory with another block of
  126. the same size given by the destination start address.
  127.  
  128. Description:    If there are any differences found between the two specified
  129. blocks the are reported as follows:
  130.         <source address> <source byte> <dest address> <dest byte>
  131.  
  132. The address is displayed in standard segment:offset form and the byte at
  133. that address is displayed in both hexadecimal and ASCII forms.
  134.  
  135. If there are no differences between the two blocks EdBin will not display
  136. anything and simply return with the ' - ' prompt to indicate that the blocks
  137. are identical.
  138.  
  139. The Compare command can be used on blocks up to 64Kbytes in length by
  140. specifying an end offset of 0 for the source end address.  If a compare of
  141. greater than 64Kbytes is required it can be done in blocks of 64Kbytes.
  142.  
  143. Example:        C 300 500 1000
  144. will compare 200H bytes at 300H to 4FFH in the current segment with 200H
  145. bytes and 1000H bot 11FFH in the same segment.
  146.  
  147.         C 0 0 2000:0
  148. compares the whole 64Kbytes of the current segment with another 64K block at
  149. 2000:0
  150.  
  151.  
  152.  
  153. D(ump)
  154.  
  155. Syntax: D (<segment>:) (<start offset>) (<end offset>)
  156.  
  157. Function:       Display the specified area of memory.
  158.  
  159. Description:    The memory contents are displayed as hex values and ASCII
  160. characters.  Each line of the memory dump displays the memory address in
  161. segment:offset form followed by 16 bytes o hex values and 16 bytes of ASCII
  162. characters.  Characters outside the ASCII range 20H-7EH are shown as a full
  163. stop.  All the parameters in the above command are optional.  If the segment
  164. address is omitted the last value will be used, if the start and end offsets
  165. are omitted the last end address is used as the start address and the last
  166. end address + 080H is used as the end address, if the end address is omitted
  167. the start address + 080H is used.
  168.  
  169. Note - the above applies only if no other intervening commands have been
  170. used which change the current segment address or current offset address.
  171.  
  172. The minimum number of bytes that can be displayed is 16 bytes ie
  173.         D 100 105
  174. will display 100H to 10FH.
  175.  
  176. Example:        D 1000 1580
  177. will display memory from 1000H to 157FH inclusive in the current segment in
  178. the format described above.  If the dump command is subsequently used with
  179. no parameters, ie,
  180.         D
  181. 128 bytes of memory from 1580H to 15FFH will be displayed.  Further D
  182. commands entered with no parameters will display the next 128 bytes of
  183. memory.
  184.  
  185.  
  186. E(dit)
  187.  
  188. Syntax: E (<segment>:) <start offset>
  189.  
  190. Function:       Allows memory contents to be examined and new valued to be
  191. entered if required.
  192.  
  193. Description:    A line of 16 bytes of memory is displayed in hex and ASCII
  194. formats initially with the cursor under the least significant digit of the
  195. first byte specified.  Cursor movement and data entry is controlled using
  196. the following keys:
  197.  
  198. LEFT            move cursor left, if at far left display previous 16 bytes
  199. RIGHT           move cursor right, if at far right display next 16 bytes
  200. UP              display next 16 bytes
  201. DOWN            display previous 16 bytes
  202. SHIFT-LEFT      move cursor to far left of current field
  203. SHIFT-RIGHT     move cursor to far right of current field
  204. COPY-DELETE     toggle between hex field and ASCII field
  205.  
  206. The display consists of two 16 byte fields - a hex display and an ASCII
  207. display.  The COPY-DELETE keys are used to switch between the two fields. 
  208. (NOTE - on the Master 512 COPY is used as the ALTernate shift key of an IBM
  209. keyboard hence it should not be used like a SHIFT key ie to toggle between
  210. the data entry fields COPY should be pressed down first and held while
  211. DELETE is pressed).  While the cursor is in th hex field data is entered in
  212. hex digits, each digit being shifted in from the right.  To advance to the
  213. next field the normal cursor keys are used.  SHIFTed cursor keys are used to
  214. move to the far left or right of the current field.  If the cursor is in the
  215. ASCII field data is entered as ASCII bytes.  The cursor is automatically
  216. advanced to the next field to allow text to be typed in directly.  When text
  217. is entered at the far right of the field the next 16 bytes are automatically
  218. displayed to allow typing to continue over 16 byte boundaries.
  219.  
  220. NOTE - if data is being entered in the ASCII field, control codes in the
  221. range 0 to 31 can be entered by pressing the appropriate key in conjunction
  222. with the CTRL key.  ie CTRL-Z will enter the end of text market 1AH.  The
  223. only exception is CTRL-C (value 03H) which is used to terminate the command. 
  224. If the user wishes to enter this code it must be entered in the hex data
  225. field as hex digits 03.
  226.  
  227. The E(dit) command is terminated by pressing CTRL-C.
  228.  
  229. Example:        E 3000:560
  230. will display
  231. 3000:560 41 20 62 6F 74 20 6F 66 20 74 65 78 1A 07 00 A bit of text....
  232.  
  233. The spelling mistake in the text can be corrected by two methods:
  234.  
  235. 1.  Move the cursor to the fourth byte in the hex field and enter the hex
  236. digits 6 and 9. 
  237.  
  238. 2.  Use COPY-DELETE to move to the ASCII field of the display and move to
  239. the fourth byte in this field and enter the character i.
  240.  
  241. CTRL-C is then entered to terminate the command for both methods.
  242.  
  243. The editing can be checked by for example entering the command D 560 570
  244. which should display 3000:560 41 20 62 69 74 20 6F 66 20 74 65 78 74 1A 07
  245. 00 A bit of text.....
  246.  
  247.  
  248. F(ill)
  249.  
  250. Syntax: F (<segment>:) <start offset> <end offset> <fill byte | word>
  251.  
  252. Function:       Fills memory with a constant value between the specified
  253. addresses.
  254.  
  255. Description:    The constant used can be specified as a byte or word value. 
  256. If a word value is specified the least significant byte is written first. 
  257. An end offset of 0 can be used to specify a fill operation to the last byte
  258. in the specified segment.
  259.  
  260. Example:        F 1000 1010 55
  261. will fill bytes 1000H to 100FH inclusive with the value 55H.
  262.  
  263.         F 1000 1010 1234
  264. will fill bytes 1000H to 100FH inclusive with the word 1234H with the least
  265. significant byte written first.
  266.  
  267.  
  268. H(elp)
  269.  
  270. Syntax: H
  271.  
  272. Function:       Give help information.
  273.  
  274. Description:    The H command displays the EdBin version number and a list
  275. of available commands with their required syntax.  It does not take any
  276. parameters.
  277.  
  278. Example:        H
  279.  
  280.  
  281. M(ove)
  282.  
  283. Syntax: M (<segment>:) <source start> <source end> (<segment>:) <dest start>
  284. where   <start> = <start offset> ; <end> = <end offset>
  285.         <dest>  = <destination>
  286.  
  287. Function:       Move a block of memory to specified address.
  288.  
  289. Description:    The specified block of memory is moved to the destination
  290. address.  The block of memory at the source address is not generally
  291. affected by the move - it is simply copied to the given address.  if an
  292. overlapping move is specified (ie a move where part of the destination block
  293. overlaps the source block) the data that could be overwritten by the
  294. operation is always moved first to ensure that the destination data is
  295. correct.  The user should be aware that in these cases the source block must
  296. inevitably be corrupted in the overlapping area.
  297.  
  298. Example:        M 100 740 1200:10
  299. moves 640H bytes from 100H to 73FH to address 10H in segment 1200H.
  300.  
  301.  
  302. Q(uit)
  303.  
  304. Syntax: Q
  305.  
  306. Function:       Exit EdBin and return to the DOS + command line prompt.
  307.  
  308. Description:    The Q command is used with no parameters.  It closes the
  309. currently active file (if one exists), restores the DOS+ system environment
  310. and returns to the DOS+ command line prompt.
  311.  
  312. Example:        Q
  313.  
  314.  
  315. R(ead)
  316.  
  317. Syntax: R <filename>
  318.  
  319. Function:       Read a file into memory.
  320.  
  321. Description:    The specified file is read into memory at the start of the
  322. file buffer.  The size of the file and the number of bytes actually read are
  323. displayed as the file is being loaded into memory.  These two numbers should
  324. normally be the same but in the event of a disc error the number of bytes
  325. read will indicate how much of the file can be recovered.
  326.  
  327. When a file is loaded using the Read command the specified <filename>
  328. becomes the currently active file (CAF).  The will remain active until a
  329. subsequent Read operation which will close the previous CAF and the newly
  330. loaded file becomes the new CAF. NOTE - if EdBin is executed with a filename
  331. on the command line ie,
  332.         EDBIN TEST.DAT
  333. then TEST.DAT will automatically be loaded into memory as if a R TEST.DAT
  334. command had been entered.  The file TEST.DAT therefore becomes the currently
  335. active file.  (For more information of the use of the currently active file
  336. see the Write command).
  337.  
  338. Example:        R FILE.EXE
  339. loads the file FILE.EXE into memory at the start of the file buffer and
  340. reset the current command segment/offset variables so that file editing
  341. commands will operate on the file buffer.
  342.  
  343. NOTE - EdBin will always load the file into memory at the start of its file
  344. buffer regardless of the type of file ie CMD or EXE files will not have the
  345. file header stripped off - the file will be loaded into memory in the same
  346. form as it appears on disc.  The user should therefore be aware that in the
  347. above two cases the start of the code segment will be offset by the length
  348. of the header.
  349.  
  350. S(earch)
  351.  
  352. Syntax: S (<segment>:) <start offset> <end offset> <"string">
  353.  
  354. Function:       Search memory fo a specified text string.
  355.  
  356. Description:    If any matching text strings are found it is reported as the
  357. start address of the string in segment:offset form.  The address given is of
  358. the first byte of the matching string.  The search string must be enclosed
  359. in double quotes (") and can be up to 72 characters long.  (Maximum length
  360. for complete command line is 80 characters).  The end offset specified is
  361. the end address +1 of the search area so to allow the search to continue
  362. right up to the end of a segment an end address of 0 can be specified ie
  363.  
  364.         S 4000 0 "eric"
  365.  
  366. will search from 04000H up to 0FFFFH inclusive.  The condition for a string
  367. to be found is that it must be completely contained within the search area,
  368. ie if string "eric" lives at 03FFDH then
  369.  
  370.         S 0 4000 "eric"
  371.  
  372. will not report it but if our string "eric" lives at 03FFCH then the above
  373. search will find it.  Any 8 bit character string can be searched for using
  374. escape sequences to allow control codes and characters above 07FH to be
  375. specified.  (NB these are compatible with the MOS escape sequences).  The |
  376. character is used to denote an escape sequence.
  377.  
  378. The following table shows how all the characters are specified.
  379.  
  380.         String          Hex Byte
  381.         "|@"            0
  382.  
  383.         "|a" or "|A"            1
  384.         to              to
  385.         "|z" or "|Z"            1A
  386.  
  387.         "|["            1B
  388.         to              to
  389.         "|_"            1F
  390.         String          Hex Byte
  391.         " "             20
  392.         to              to
  393.         "~"             7E
  394.  
  395. except for following two special cases:
  396.         """"            22
  397.         "||"            7C
  398.  
  399. Delete is entered as follows:
  400.         "|?"            7F
  401.  
  402. Characters above 128 can be entered using the |! operator ie:
  403.         "|!<char>"              80-FF
  404. where <char> is any of above 7 bit chars
  405.  
  406. Note - the characters in the search string are case dependent ie "ABC" will
  407. match "ABC" only not "abc" or "AbC" etc.
  408.  
  409. Any escape arguments not recognised are reduced to the argument alone ie
  410. "|1" is reduced to "1" etc. and any surplus redundant "|!" operators are
  411. ignored  ie "|!|!|@" is reduced to "|!|@".
  412.  
  413. Any string not terminated by a " character or containing an odd number of "
  414. characters will be reported as bad string ie:
  415.         String          Error
  416.         "abc            No terminating "
  417.         "ab""           Single quote character in string
  418.         "ab"""c"        as above
  419.  
  420. A Bad String error will also be generated if no argument is supplied for the
  421. escape character | or if a null string or equivalent is specified ie
  422.  
  423.         String  Error
  424.         "a|"    No escape argument
  425.         ""      Null string
  426.         "|!"    Reduced to null string hence as above
  427.  
  428. The search operation can be terminated at any time by pressing CTRL-C.
  429.  
  430. Example:        S 100 7B00 "a text string"
  431. will search from 100H to 7AFFH for the string "a text string".  Any
  432. occurrences of the string in the specified area might be reported as:
  433.  
  434.         01F3:0151
  435.         01F3:0279
  436.         01F3:7A01
  437.  
  438.  
  439. W(rite)
  440.  
  441. Syntax: W (<filename>)
  442.  
  443. Function:       Writes the specified file or currently active file to a disc
  444. file.
  445.  
  446. Description:    If the W command is used with no <filename> the modified
  447. data in memory is written back to the currently active file that was
  448. specified in the last R command.  If a <filename> is specified the data is
  449. written instead to this specified file.  Note that using the W command with
  450. a filename does not affect the currently active filename - therefore
  451. subsequent W commands with no filename will write the data to the filename
  452. specified in the last R command.
  453.  
  454. When writing out the file the number of bytes written is displayed on the
  455. screen - if EdBin cannot write out all the bytes to disc an error message
  456. will be given to indicate that the disc is probably full.
  457.  
  458. Example:        W
  459. writes data from the file buffer to the currently active filename.  The
  460. number of bytes written is equal to the length of the file loaded in by the
  461. R command.
  462.  
  463.  
  464. 1.4  Error Messages
  465.  
  466. The following table lists the errors that may occur while using EdBin:
  467.  
  468. Error Message   Cause
  469. File not found  The R command has been used to try and read in a file that
  470.                 does not exist on the disc or the full pathname for the file
  471.                 has not been specified.
  472.  
  473. Path not found  The R <filename> or W <filename> command has been used to
  474.                 read or write a file in a directory that does not exist.
  475.  
  476. Too many open files     
  477.                 The R command or W <filename> command has been used to try
  478.                 to open a file when there are already 20 open files.  This
  479.                 error should not normally occur and it will only happen if
  480.                 some previous application has not closed its files on exit. 
  481.                 EdBin requires only 2 files open at any time.
  482.  
  483. Access denied   The R command has been used on a Read Only file.  The R
  484.                 command  attempts to open a file for R/W access assuming
  485.                 that the user may want to write the modified data back to
  486.                 the same file.  To prevent this error the file should be set
  487.                 to R/W using FSET before entering EdBin.  This error may
  488.                 also occur if W <filename> has been used to write to a file
  489.                 that has the same name  as an existing file that is marked
  490.                 R/O or if the specified directory is full.
  491.  
  492. Illegal file handle     
  493.                 The W command has been used when there is no Currently
  494.                 Active File to  write the data to.  The CAF must be
  495.                 activated by an R command or by specifying a filename in the
  496.                 command line when EdBin is started up.
  497.  
  498.  
  499. MOVE Utility
  500.  
  501. Syntax:
  502. MOVE <source filespec> <-fs> [/option] <dest dirspec> <-fs> [/option]
  503.  
  504. Explanation:
  505. The MOVE command copies files between DOS+ and BBC filing systems.  It is
  506. intended primarily for saving DOS+ files on ANFS or ADFS but some support is
  507. provided for other filing systems (ie DFS).  In this document the DOS+
  508. operating system will be referred to as DOS and BBC filing systems (ANFS and
  509. ADFS) will be referred to as MOS filing systems.  Files that have been
  510. originally save under DOS+ ie utilities such as DISK.CMD, COLOUR.EXE or text
  511. files such as LETTER.DOC are referred to as DOS PLUS files and file that
  512. have been originally saved under ANFS  or ADFS ie BBC BASIC files or VIEW
  513. documents are referred to as MOS files.  The MOVE utility enables DOS PLUS
  514. files to be transferred from DOS to MOS and then copied back from MOS to DOS
  515. with the original filename, filetype and attributes preserved.  MOS files
  516. can be copied to DOS but the filename by be truncated and file attributes
  517. will not be saved.
  518.  
  519. The <source filespec> can be used to specify a single file or multiple files
  520. using the wild card characters * and ? for DOS and * and # for MOS.  The
  521. source files can be specified using any valid DOS or MOS pathname.  MOVE
  522. does not recognise passwords in DOS file specifications - if files are
  523. password protected a default password must be set.
  524.  
  525. The <dest dirspec> is used to identify the destination directory which can
  526. be specified using any valid DOS or MOS pathname.  The special character @
  527. is used to indicate the currently selected destination directory for both
  528. DOS and MOS operations.  (NOTE - as @ is a valid filename character under
  529. DOS is should not be used as a directory name as a conflict will occur). 
  530. The /r option can be used in a destination specification to allow single
  531. files to be copied to the given filename rather than being copied with the
  532. same name to the given directory.
  533.  
  534. The <-fs> field is used to indicate the source or destination filing system
  535. as follows:
  536.  
  537.         Filing System           <-fs>
  538.         DOS PLUS                -dos
  539.         ADFS                    -adfs
  540.         ANFS                    -net
  541.         DFS                     -disc
  542.  
  543. The [/option] field specifies the following optional parameters:
  544.  
  545. Option  Description
  546. /C      Only valid for MOS source filespec - allows filetype subdirectories
  547.         to be copied from MOS to MOS (Default for MOS to MOS copy is to
  548.         ignore FSD's)
  549.  
  550. /|      Only valid for MOS source filespec - specifies that filetype
  551.         subdirectories should be ignored. It is only needed in MOS to DOS
  552.         copies as it is the default setting for MOS to MOS copies. It allows
  553.         DOS files with no extension to be coped from MOS.
  554.  
  555. /S      Only valid for source files.  It is used to copy DOS system files.
  556.  
  557. /R      Only valid for destination files and single file copies.  It is used
  558.         to specify a destination filename instead of a directory name.
  559. Example: A>MOVE SDIR.CMD -DOS :1.$.DOSPLUS -ADFS
  560.  
  561. This copies the file SDIR.CMD from the current directory on DOs drive A to
  562. the directory :1.$.DOSPLUS on ADFS drive 1.
  563.  
  564.  
  565. Copying files between DOS and MOS
  566.  
  567. This section explains how to copy a group of files from DOs to a MOS filing
  568. system (ANFS in this example) and then how to copy them back to DOS.  It is
  569. assumed that the user has already logged on to the network by some means (ie
  570. the STAR utility), has created a directory called DOSPLUS in the Users Root
  571. Directory (URD), and it is the Currently Selected Directory (CSD).  (See
  572. ANFS documentation for explanation of URD, CSD).  It is not absolutely
  573. necessary to create a separate directory for DOs files but it is STRONGLY
  574. RECOMMENDED as mixing DOS and MOS files in the same directory will probably
  575. cause confusion and may cause MOS files to be copied unnecessarily during
  576. MOS to DOS transfers.
  577.  
  578. The following command will copy all the files from DOs drive B with the BAT
  579. extension to the CSD on ANFS (ie DOSPLUS) (NOTE - the A> prompt should not
  580. be typed in the following examples - it is included to indicate the current
  581. DOS drive)
  582.  
  583.         A>MOVE B:*.BAT -DOS @ -NET
  584.  
  585. To copy the files back from ANFs to the CSD on DOS drive A type
  586.  
  587.         A>MOVE BAT.* -NET @ -DOS
  588.  
  589. NOTE that the source specification for the ANFS files reverses the filetype
  590. and filename of the DOS file specification.  This is necessary because of
  591. the way that DOs files are stored under ANFS or ADFS (See later section).
  592.  
  593. To copy all the files from subdirectory GEM on DOS drive A to the same
  594. directory on ANFS use
  595.  
  596.         A>MOVE \GEM\ *.* -DOS @ -NET
  597.  
  598. To copy all the files back from ANFS to DOS directory GEMBAK on drive B type
  599.  
  600.         A>MOVE * -NET B:\GEMBAK -DOS
  601.  
  602. NOTE that for the ANFS source specification * is equivalent to the DOS *.*
  603. and copies all the files from the current directory.
  604.  
  605.  
  606. Copying directories between DOS and MOS
  607.  
  608. The above example shows how to copy files from DOS to a single MOS directory
  609. ie all the files were being copied to the same ANFS directory.  This method
  610. is adequate if the source DOS disc does not contain any DOS subdirectories
  611. (DSD's) or if only a small number of files are to be copied.  However if the
  612. source DOS disc contains several subdirectories (which may themselves
  613. contain further subdirectories) then copying all the files to the same ANFS
  614. directory would result in loss of the DOS directory structure.  To allow
  615. DSD's to be created in an MOS directory the special character \ is used as
  616. the first character of the DSD name.  This is necessary because of the way
  617. that DOS files are stored in MOS filing systems.  DOS files that have no
  618. filetype extension ie INVOICE are stored in the specified destination
  619. directory.  Files that have a filetype extension ie LETTER.BAK are stored in
  620. a directory BAK with the name LETTER.  The filetype subdirectory (FSD) is
  621. automatically created if not already present.  Similarly the file VDU.EXE
  622. would be stored in an FSD called EXE with the name VDU.  As DOS filetype
  623. extensions can be no longer than 3 characters any subdirectories with a name
  624. longer than 3 characters will be ignored in a MOS to DOS file copy.  This
  625. provides another means of distinguishing between DSD's and FSD's in the same
  626. MOS directory ie if the DSD name is longer than 3 characters it will not be
  627. mistaken for a filetype subdirectory.  The following diagram illustrates the
  628. mapping between a DOS directory structure and an equivalent MOS directory
  629. structure.
  630.  
  631. (Draw file 'DOStoMOS')
  632.  
  633. The above example shows how files would be copied from DOs drive A: to an
  634. ANFS directory $.eric.dosplus ie to directory DOSPLUS in user ERIC on the
  635. network.  It is important to note that the DOS Root Directory (DRD) DOSPLUS
  636. and DOS subdirectories \LC, \DOCNS etc are not automatically created by the
  637. MOVE utility ie MOVE does not copy a whole directory tree.  It is the users
  638. responsibility to create the DRD's and DSD's when they are required.  This
  639. is directly analogous to using the DOS PLUS COPY command which copies files
  640. between directories but requires the destination directory to be already
  641. present.
  642.  
  643. The character \ is used above to indicate DOS subdirectories in a MOS
  644. directory rather than use names of 4 or more characters.  Either method
  645. could be used interchangeably but it is better to just choose the one method
  646. that suits you and use it consistently.
  647.  
  648. The actual commands required to perform the above MOVE operation are now
  649. given as an example.  It is assumed that the following MOS * commands have
  650. already been given to prepare for the copy and ERIC is already a user of the
  651. NET.
  652.  
  653.  
  654.  
  655.  
  656.         *net
  657.         *i am eric              log on to net
  658.         *cdir dosplus           create DOS Root Directory
  659.         *cdir dosplus.\lc       create DOS SubDirectories
  660.         *cdir dosplus.\lc.\h
  661.         *cdir dosplus.\docns
  662.  
  663. Copy all files in root on DOS drive A:
  664.         A>MOVE A:\*.* -DOS DOSPLUS -NET
  665.  
  666. Copy all files in A:\DOCNS
  667.         A>MOVE A:\DOCNS\*.* -DOS DOSPLUS.\DOCNS -NET
  668.  
  669. Copy all files in A:\LC
  670.         A>MOVE A:\LC\*.* -DOS DOSPLUS.\LC -NET
  671.  
  672. Copy all files with type LIB in A:\LC\H
  673.         A>MOVE A:\LC\H\*.LIB -DOS DOSPLUS.\LC.\H -NET
  674.  
  675. The commands required for the inverse operation (ie copying from the NET to
  676. a DOs disc in drive B:) are now given.  It is assumed that the following DOS
  677. PLUS commands have been given to prepare the destination disc for the copy.
  678.  
  679.         MD B:\LC
  680.         MD B:\LC\H
  681.         MD B:\DOCNS
  682.  
  683. Copy all files from DOS Root Directory
  684.         A>MOVE &.DOSPLUS.* -NET B:\ -DOS
  685.  
  686. Copy all files from DOS Subdirectory \DOCNS
  687.         A>MOVE &.DOSPLUS.\DOCNS.* -NET B:\DOCNS -DOS
  688.  
  689. Copy all files from DOS Subdirectory \LC
  690.         A>MOVE &.DOSPLUS.\LC.* -NET B:\LC -DOS
  691.  
  692. Copy all files with type LIB from DOS Subdirectory \H
  693.         A>MOVE &.DOSPLUS.\LC.\H.LIB.* -NET B:\LC\H -DOS
  694.  
  695. NOTE - when copying from ANFS the source directory must be referred to the
  696. URD using the & character because the Currently Selected Directory on ANFS
  697. cannot be restored after the MOVE operation.
  698.  
  699.  
  700. Copying files between MOS and MOS
  701.  
  702. In addition to copying files between DOS and MOS, files can also be copied
  703. directly from MOS to MOS using either two different filing systems or the
  704. same filing system as source and destination.  When copying files between
  705. MOS filing systems MOVE will only copy files from the specified directory
  706. and will not search any filetype subdirectories unless the /C option is
  707. supplied.  The default operation provides the same type of copy as performed
  708. by the ADFS and DFS *COPY command or MOS *MOVE command and is therefore
  709. suitable for copying MOS files (ie BBC BASIC programs or VIEW text files). 
  710. It is also possible to copy an MOS directory that contains DOS files and DOS
  711. filetype subdirectories by specifying the /C option in the source filespec. 
  712. This type of operation is most suitable for copying DOS files that have been
  713. saved to MOS by a previous MOVE command.
  714.  
  715. As an example the DOS files copied to the NET directory DOSPLUS in the
  716. previous section could be copied to an ADFS directory $.DOSPLUS on drive 1. 
  717. The ADFS disc must first be prepared for the copy by issuing the following *
  718. commands:
  719.  
  720.         *adfs
  721.         *dir :1
  722.         *cdir dosplus
  723.         *cdir dosplus.\lc
  724.         *cdir dosplus.\lc.\h
  725.         *cdir dosplus.\docns
  726.  
  727. and then giving the following MOVE commands:
  728.         A>MOVE &.DOSPLUS.* -NET /C :1.$.DOSPLUS -ADFS
  729.         A>MOVE &.DOSPLUS.\DOCNS.* -NET /C :1.$.DOSPLUS.\DOCNS -ADFS
  730.         A>MOVE &.DOSPLUS.\LC.* -NET /C :1.$.DOSPLUS.\LC -ADFS
  731.         A>MOVE &.DOSPLUS.\LC.\H.LIB.* -NET /C :1.$.DOSPLUS.\LC.\H -ADFS
  732.  
  733. If user ERIC on the NET also has directories $.ERIC.BASIC and $.ERIC.VIEW
  734. which contain BBC BASIC files and VIEW text files respectively then these 
  735. can be copied to the same ADFS disc (assuming directories :1.$.BASIC and
  736. :1.$.VIEW are present) using these two MOVE commands.
  737.  
  738.         A>MOVE &.BASIC.* -NET :1.$.BASIC -ADFS
  739.         A>MOVE &.VIEW.* -NET :1.$.VIEW -ADFS
  740.  
  741.  
  742. Wild Card File Specifications
  743.  
  744. In the examples given so far a group of files has been specified by the *
  745. wild card character which matches all the files in the source directory for
  746. both DOS and MOS files.  It is also possible to specify that only certain
  747. files that match a given pattern of characters will be copied using
  748. combinations of the wildcard characters *, ? and #.  The wildcard characters
  749. have different meanings dependent on the source filing system as given by
  750. the following table.
  751.  
  752. Filing System           Wildcard              No. Characters Matched
  753. DOS                        *                    0-8 
  754. DOS                        ?                    0-1 
  755. MOS                        *                    0-10 
  756. MOS                        #                    1
  757.  
  758. There are certain differences between the use of wildcards for DOs and MOS
  759. filing systems which should be noted.  To illustrate this consider the
  760. following DOs files that have been copied to a MOS filing system.
  761.  
  762. A.BAT   AA.BAT   AB.BAT   ABC.BAT   TEXT1B.DOC   TEXT2B.DOC   TESTB.DOC
  763.  
  764. These files will be saved under MOS with the following names:
  765.  
  766. BAT.A   BAT.AA   BAT.AB   BAT.ABC   DOC.TEXT1B   DOC.TEXT2B   DOC.TESTB
  767. The following table shows the files matched by the given DOS and MOS
  768. wildcard specs:
  769.  
  770. Filing System           Wildcard                Files Matched
  771. DOS                     *.*                     All 7 DOS files
  772. DOS                     A*.BAT                  A.BAT   AA.BAT   
  773.                                                         AB.BAT   ABC.BAT
  774. DOS                     A?.BAT                  A.BAT  AA.BAT  AB.BAT
  775. DOS                     TE?TB.DOC               TEXT1B.DOC   TEXT2B.DOC   
  776.                                                         TESTB.DOC
  777.  
  778. MOS                     *                       all 7 MOS files
  779. MOS                     BAT.A*                  BAT.A   BAT.AA   BAT.AB   
  780.                                                         BAT.ABC
  781. MOS                     BAT.A#                  BAT.AA   BAT.AB
  782. MOS                     DOC.TE#T#B              DOC.TEXT1B   DOC.TEXT2B
  783.  
  784. MOS                     BAT.*A                  BAT.A   BAT.AA
  785. MOS                     DOC.T*B                 DOC.TEXT1B   DOC.TEXT2B   
  786.                                                         DOC.TESTB
  787. MOS                     DOC.T*X*B               DOC.TEXT1B   DOC.TEXT2B
  788.  
  789. From the table it can be seen that ? and # behave differently because ? will
  790. match 0 or 1 characters but # will match 1 character only.  The * character
  791. functions identically for DOS and MOS if it is used as the last character of
  792. the filename or filetype.  When using MOS wildcard specs the * character
  793. does not have to be the last character of the filename or filetype hence it
  794. is possible to use patterns such as *A (all files ending in A) and T*B (all
  795. files starting with T and ending with B).  These patterns are illegal under
  796. DOS  and will give an error message if used.  Care must therefore be taken
  797. when copying back from MOS to DOS to ensure that the wildcard spec will copy
  798. all the required files.  If in doubt about whether all the required files
  799. will be copied it is best to use a pattern which will copy more files than
  800. required (ie A* not A#) and then delete any files not required.
  801.  
  802. NOTE - Wildcard filespecs can be used only on MOS filing systems that
  803. support the OSGBPB function with A = 8 (Read names from current directory). 
  804. This includes DFS, ADFS, NFS and ANFS but NOT CFS or RFS.  For CFS and RFS
  805. filespecs must specify a single file only (ie contain no wildcard
  806. characters).    
  807.  
  808.  
  809. Filename Character Translation
  810.  
  811. When copying from DOS to MOS the destination filename is formed from the
  812. filename and filetype of the source DOS file.  In a few special cases this
  813. can produce a destination filename which contains invalid characters and
  814. therefore cannot be saved to the MOS filing system.  To overcome this
  815. problem the invalid characters are translated to valid MOS characters to
  816. allow the file to be saved.  When the file is subsequently copied back from
  817. MOS to DOS the invalid characters are translated back again to restore the
  818. file's original name.  The following table shows the character translation
  819. used.
  820.  
  821.         DOS character           MOS character
  822.         #               ?
  823.         $               £
  824.         &               {
  825.         -               +
  826.         @               =
  827.  
  828. The corresponding MOS characters have been chosen to ensure that no conflict
  829. will occur with other non alphanumeric DOS characters that do not require
  830. translation (see below).
  831.  
  832. When copying MOS files from MOS to DOS (ie VIEW text file) the following
  833. additional non alphanumeric characters are invalid under DOS and are
  834. translated to the underline character _.
  835.  
  836.         !  \  {  }  [  ]  ;  /  <  >
  837.  
  838. The following non alphanumeric characters are valid under both MOS and DOS.
  839.  
  840.         %  '  (  )  _  ~
  841.  
  842.